package com.wcm.system.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

/**
 * @Author：dapan
 * @Description:cadota
 * @Date:Create in 12:00 2018/4/23
 * @Modifird By:
 */
public class DataSource {
    @Autowired
    private Environment env;

    @Bean
    public DruidDataSource getDataSource() {
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        dataSource.setUrl(env.getProperty("jdbc:sqlserver://localhost:1433;databasename=EAPortal-MZS-SKW"));
        dataSource.setUsername(env.getProperty("sa"));
        dataSource.setPassword(env.getProperty("MIMAmima17"));
        return dataSource;
    }
}
